{include file="public/header" /}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.css"}
{load href="__PLUGINS__bootstrap/bootstrap-table.min.js"}
<style>
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0;
        margin-top: 0
    }

    #title span {
        float: right;
    }

    .asdlkjasd {
        background: #1ab394;
        color: #fff
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content {:config('adminClass.main')}">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            {include file="public/topsection"}
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="fixed-table-toolbar" style="text-align: center;margin-bottom: 20px">
                        <h2>{eq name='channel' value='1'}金币{/eq}{eq name='channel' value='2'}积分{/eq}统计: <span style="color: #1ab394; ">{$sumInfo}</span></h2>
                    </div>
                    <div class="fixed-table-toolbar">
                          <a class="btn btn-default btn-outline {eq name='channel' value='1'}asdlkjasd{/eq}" href="{:url('rengong',['channel' => 1])}">金币</a>
                        <a class="btn btn-default btn-outline {eq name='channel' value='3'}asdlkjasd{/eq}" href="{:url('rengong',['channel' => 3])}">赠送金币</a>
                        <a class="btn btn-default btn-outline {eq name='channel' value='2'}asdlkjasd{/eq}" href="{:url('rengong',['channel' => 2])}">积分</a>
                        <a class="btn btn-default btn-outline {eq name='channel' value='4'}asdlkjasd{/eq}" href="{:url('rengong',['channel' => 4])}">豆豆</a>
                        <!-- 新增：增加/扣减筛选按钮（调整"全部"按钮位置到最前） -->
                        <div class="pull-right">
                            <a class="btn btn-default btn-outline {eq name='towardx' value='' or name='towardx' notset}asdlkjasd{/eq}" href="{:url('rengong',['channel' => $channel])}">全部</a>
                            <a class="btn btn-default btn-outline {eq name='towardx' value='1'}asdlkjasd{/eq}" href="{:url('rengong',['channel' => $channel, 'towardx' => 1])}">增加</a>
                            <a class="btn btn-default btn-outline {eq name='towardx' value='0'}asdlkjasd{/eq}" href="{:url('rengong',['channel' => $channel, 'towardx' => 0])}">扣减</a>
                        </div>
                    </div>

                    <div style="display:block;clear: both;"></div>
                    <div class="fixed-table-toolbar">
                        <form  method="get" action="" style="display: flex;">
                            <div class="pull-left search" style="display: flex;">
                                <div class="columns columns-right btn-group pull-left">
                                    <select class="form-control" name="search">
                                        <option value="id" {php}if(input('?param.search')){if(input('param.search')=='id'){echo "selected";} }{/php}>会员ID</option>
                                        <option value="name" {php}if(input('?param.search')){if(input('param.search')=='name'){echo "selected";} }{/php}>昵称</option>
                                    </select>
                                </div>

                                <div class="pull-right search">
                                    <input class="form-control input-outline" type="text"
                                           {php}
                                           if(input('?param.name')){
                                    if(input('param.name')){
                                    echo "value='".input('name')."'";
                                    }

                                    }
                                    {/php}
                                    name="name" placeholder="搜索">
                                </div>

                                <div class="pull-right search">
                                    <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px" class="btn btn-default btn-outline" type="submit">搜索</button>
                                </div>

                                <input name="date" type="text" id="date" class="form-control layui-input" value="{present name="date"}{$date}{/present}" placeholder="请选择时间" autocomplete="off" style="height:34px;width:100px;margin:0 10px;">

                                {php}
                                if(input('?param.name')){
                                {/php}
                                <div class="pull-right search">
                                    <a class="btn btn-w-m btn-link" href="{:url('rengong')}">返回充值管理</a>
                                </div>{php}
                                }
                                {/php}

                            </div>
                        </form>
                    </div>
                    <div class="example">
                        <form class="form-horizontal" method="post">
                            <table data-toggle="table">
                                <thead>
                                <tr>
                                    <th data-align="center">记录ID</th>
                                    <th data-align="center">用户</th>
                                    <th data-align="center">金额</th>
                                    <th data-align="center">类型</th>
                                    <th data-align="center">说明</th>
                                    <th data-align="center">操作人</th>
                                    <th data-align="center">操作时间</th>

                                    <!--<th>管理</th>-->
                                </tr>
                                </thead>
                                <tbody id="form">
                                {php}$hide=array('0'=>'<font color="#f00">禁止</font>','1'=>'<font color="#1ab394">正常</font>','2'=>'审核','3'=>'<font color="#f00">拒绝</font>');{/php}
                                {volist name="data" id="v"}
                                <tr id="id{$v.id}" class="class">
                                    <td>{$v.id}</td>
                                    <td><a onclick="member('{$v.user_id}')" style="color:#40BCF7">{$v.name}（{$v.user_id}）</a></td>
                                    <td>{$v.money}</td>
                                    <td>{$v.toward == 1 ? '<span style="color: green;">增加</span>' : '<span style="color: red;">扣除</span>' }</td>
                                    <td>{$v.content}</td>
                                    <td>{$v.admin}</td>
                                    <td>{$v.time}</td>

                                    <!--<td>
                                        <div class="btn-group">
                                            <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">操作 <span class="caret"></span>
                                            </div>
                                            <ul class="dropdown-menu">
                                                <li><a onClick="del({$v.id})">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>-->
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
    layui.use(['laydate'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        //执行一个laydate实例
        laydate.render({
            elem: '#date' //指定元素
            ,type: 'date'
            ,trigger: 'click'
        });
    })

    function del(id){
        swal_del(id,"{:url('topupdel')}")
    }

    function member(id)
    {
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.open({
                title :'预览',
                area: ['100%', '100%'],
                type: 2,
                content: '{:url("index")}?search=id&name='+id
            });
        });
    }

</script>
